home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 June / june_2001.iso / Html / CuteHtml / setup.exe / +PASSWORD PROTECTED SITE WITH ABILITY TO ADD NEW USERS.JS < prev    next >
Encoding:
Text File  |  1999-09-03  |  1002 b   |  45 lines

  1. <script language="JavaScript">
  2. <!-- This Script And Over 400 Others Found At --!>
  3. <!--    Java City 2000 http://www.jc2k.com    --!>
  4.  
  5. <!--
  6. //The page they go to if they get it right.
  7. var goodURL = "correct.html"
  8.  
  9. alert("To access the following document, you must pass a "
  10. +"members-only, authorization test.\n \n At the appropriate "
  11. +"time, enter in your username and password.")
  12.  
  13. var username = prompt("Enter in your username","")
  14. var password = prompt("Enter in your password","")
  15.  
  16. if (username == null || password == null) {
  17.  
  18. alert("Authenification failed!!!")
  19. history.back();
  20. }
  21.  
  22. else {
  23. var combo = username + password
  24. var total = combo.toLowerCase()
  25.  
  26. //This next line is where you can add usernames and passwords.
  27. if (total == "mynamemypass" || total == "name2pass2" || total == "josh1help1") {
  28.  
  29. alert("You passed authenification!  Come right in")
  30.  
  31. location = goodURL
  32.  
  33. }
  34.  
  35.  
  36. else {
  37.  
  38. alert("Authenification failed!!!")
  39. history.back();
  40. }
  41. }
  42.  
  43. //-->
  44. </script>
  45.